package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: ysotirov
 * Date: 30/01/13
 * Time: 18:36
 * To change this template use File | Settings | File Templates.
 */
public class MainMenu extends Menu {

    ArrayList<Menu> mainMenuOptions;

    public MainMenu(IOInterface ioHndl,Biblioteca bibl)
    {
        super(ioHndl,bibl);
        OptionList.add("1. Select Books Menu");
        OptionList.add("2. Select Members Menu");
        OptionList.add("3. Select Movies Menu");
        OptionList.add("4. Quit");
        mainMenuOptions = new ArrayList<Menu>();
        mainMenuOptions.add(new BooksMenu(ioHndl,bibl));
        mainMenuOptions.add(new MembersMenu(ioHndl,bibl));
        mainMenuOptions.add(new MoviesMenu(ioHndl,bibl));
        mainMenuOptions.add(new QuitMenu(ioHndl,bibl));
        titleMsg = "Main Menu";
        selectOptionMsg = "Please select one of the above options";
    }



    @Override
    public void executeOption(int opt) {

        mainMenuOptions.get(opt-1).displayMenu();
        int choice = getUserChoice();
        mainMenuOptions.get(opt-1).executeOption(choice);


    }

}
